package hevs.eServices.client.object;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("serial")
public class Meter implements Serializable {
	
	
	// Attributs
	private int id;
	private String fluid;
	private String meterType;
	
	private Item item;
	private List<Data> listData = new ArrayList<Data>();
	private List<Property> listProperty = new ArrayList<Property>();
	
	// Constructors
	public Meter() {

	}

	public Meter(int id, String fluid, String meterType) {
		this.id = id;
		this.fluid = fluid;
		this.meterType = meterType;
	}


	// Getters - Setters
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getFluid() {
		return fluid;
	}

	public void setFluid(String fluid) {
		this.fluid = fluid;
	}

	public String getMeterType() {
		return meterType;
	}

	public void setMeterType(String meterType) {
		this.meterType = meterType;
	}

	
	// Relation Getters - Setters
	public Item getItem() {
		return item;
	}
	public void setItem(Item item) {
		this.item = item;
	}

	public List<Data> getListData() {
		return listData;
	}

	public void setListData(List<Data> listData) {
		this.listData = listData;
	}

	public void addData(Data data) {
		this.listData.add(data);
		if(data.getMeter() != this) {
			data.setMeter(this);
		}
	}
	
	public List<Property> getListProperty() {
		return listProperty;
	}

	public void setListProperty(List<Property> listProperty) {
		this.listProperty = listProperty;
	}

	public void addMeterProperty(Property property) {
		this.listProperty.add(property);
		if(property.getMeter() != this) {
			property.setMeter(this);
		}
	}
	
}
